package cn.domypay.back.utils;


import java.io.InputStream;
import java.util.Properties;
/**
 * 用户阅读properties文件
 * @author lifan sun
 *
 */

public class ReadProperties {

	private static Properties properties ;
	
	private static InputStream in;
	/**
	 * 通过文件名访问路径，返回需要的参数值
	 * @param file
	 * @return
	 */
	public static Properties init(String file)
	{
		if(null == in )
		{
			in = ReadProperties.class.getClassLoader().getResourceAsStream(file);

			try {
				if(in.available()>0)
				{
					properties = new Properties();
					properties.load(in);
				}
			
			} catch (Exception e) {
				// TODO �Զ���� catch ��
				e.printStackTrace();
			}
		}
		return properties;
	}
	
}
